import {request} from "./request";

// export function login() {
//   const options = {
//     method: 'POST',
//     url: 'http://localhost:8888/login',
//     headers: {
//       'Content-Type': 'application/x-www-form',
//       Accept: '*/*',
//       'Accept-Encoding': 'gzip, deflate, br',
//       'User-Agent': 'PostmanRuntime-ApipostRuntime/1.1.0',
//       Connection: 'keep-alive'
//     },
//     data: {username: 'admin0', password: '123456'}
//   };
//   return request(options)
// }
export function login(username, password) {
  return request({
    method: 'POST',
    url: '/login',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    data: `username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}`,
  });
}